import Vue from 'vue'
import VueRouter from 'vue-router'
// import Home from '../views/Home.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: '/index',
    meta: { title: '智慧集约化驾驶舱系统', },
  },
  {
    path: '/index',
    meta: { title: '智慧集约化驾驶舱系统', },
    component: () => import("@/views/index.vue")
  },
  {
    path: '/about',
    name: 'About',
    meta: { title: '智慧集约化驾驶舱系统', },
    component: () => import("@/views/index.vue")
    // 与index 中间地图展示不一样
  },
  {
    path: '/monitor', // 监控
    meta: { title: '监控 - 智慧集约化驾驶舱系统', },
    component: () => import("@/views/monitor.vue"),
  },

  {
    // path: '/gezi', // 货架详情
    path: '/visualShelf', // 货架详情
    meta: { title: '货架 - 智慧集约化驾驶舱系统', },
    // component: () => import("@/components/jarShow.vue"),
    component: () => import("@/components/jarShowTwo.vue"),

    // component: () => import("@/components/leaflet.vue"),
  },







// ----------------------以下为之前的样式界面-----------------------------

  // {
  //   path: '/Test',
  //   meta: {
  //     title: '测试gojs',
  //     // component: () => import("@/views/drawPath.vue")
  //     component: () => import("../views/test.vue")
  //     // component: () => import('../views/About.vue')
  //   }
  // },
  // {
  //   path: '/BOCOfZJ', // 浙江中国银行
  //   meta: { title: '档案集约化全景平台', },
  //   component: () => import("@/views/other-banks-show/BOCOfZJ.vue")
  // },
  // {
  //   path: '/CCBOfJS', // 江苏建行
  //   meta: { title: '档案集约化全景平台', },
  //   component: () => import("@/views/other-banks-show/BankOfJS.vue"),
  // },
  // {
  //   path: '/ABCOfSD', // 山东农行
  //   meta: { title: '档案集约化全景平台', },
  //   component: () => import("@/views/other-banks-show/BankOfSD.vue"),
  // },
  // {
  //   path: '/BCMOfSH', // 上海交通银行
  //   meta: { title: '档案集约化全景平台', },
  //   component: () => import("@/views/other-banks-show/BankOfSH.vue"),
  // },
  // {
  //   path: '/drawPath', // 上海交通银行
  //   meta: { title: '档案集约化全景平台', },
  //   component: () => import("@/views/drawPath.vue"),
  // }
]

const router = new VueRouter({
  routes,
  // mode: 'hash'
  mode: 'history'
})
const VueRouterPush = VueRouter.prototype.push
// 去除重复路由操作
VueRouter.prototype.push = function push(to) {
  return VueRouterPush.call(this, to).catch(err => err)
}
router.beforeEach((to, from, next) => {
  document.title = to.meta.title
  next()
})

export default router
